package com.vitalfit.model.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vitalfit.model.entity.fitness.Appointment;
import com.vitalfit.model.entity.fitness.FitnessPlan;
import com.vitalfit.model.entity.food.FoodOrder;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@DiscriminatorValue("Customer")
public class Customer extends User {

    private Boolean isDeleted = false;

    @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JsonIgnore
    private Set<Appointment> appointments = new HashSet<>();

    @OneToOne(mappedBy = "customer" ,cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JsonIgnore
    private FitnessPlan fitnessPlan;

    @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JsonIgnore
    private List<FoodOrder> foodOrders;


}
